/**
* The Footbar global namespace 
* @class Footbar.Engine
* @static
*/
if (typeof Footbar == "undefined") {
 	Footbar = {};
}

/**
 * Define The Engine Interface to be implemented by other engines.
 */
Footbar.Engine={	
	metadata:{},
	/**
	 * Initalize Engine
	 */
	init:function(){
		alert(" This Method needs to be overwriten");
	},
	/**
	 * 
	 * @param {Object} data that will be passed in following format 
	 * <code>
	 * obj={			
				title:title.textContent,
				keywords:{label:'I am a label', data:[]},
				description:'Code Description',
				code:'Sample Code',
				language:'js',
				read:false
		};
		</code>
	 */
	save:function(data){
		alert(" Base class function 'save:function(data)' needs to be Implemented ");
	},

	searchByKeywords:function(keywordsID, type){
		alert(" Base class function 'searchByKeywords:function(keywordsID)' needs to be Implemented ");		
	},
	
	searchByText:function(text){
		alert(" Base class function 'searchByText:function(text)' needs to be Implemented ");
	},
	
	/**
	 * Return the metadata of the engine;
	 */	
	getMetadata:function(){
		/*	var str="";					
			for(x in this.metadata){
				str+=x+"\n";
			}
			alert("this.metadata=\n"+str)
		*/
		return this.metadata
	},
		
	setMetadata:function(meta){
		this.metadata = meta;
	},
	
	retriveKeywordsXML:function(){
			alert(" Base class function 'retriveKeywordsXML()' needs to be Implemented ");
	},
	/**
	 * Save new snipped 
	 * @param {Object} data that will be passed in following format 
	 * <code>
	 * obj={			
				title:'Snippet title',
				keywords:{[]},
				description:'Code Description',
				code:'Sample Code',
				language:'js'
	};
		</code>
	 */
	saveSnippet:function(data){
		alert(" Base class function 'saveSnippet()' needs to be Implemented ");
	},
	/**
	 * Update existing snippet 
	 * @param {Object} data that will be passed in following format 
	 * <code>
	 * obj={			
				title:'Snippet title',
				keywords:{[]},
				description:'Code Description',
				code:'Sample Code',
				language:'js'
		};
		</code>
	 */

	updateSnippet:function(data){
		alert(" Base class function 'updateSnippet()' needs to be Implemented ");
	},	
	deleteSnippet:function(data){
		alert(" Base class function 'deleteSnippet()' needs to be Implemented ");
	},	
	
	/**
	 * 
	 * @param {Object} data
	 */
	validateBeforeSave:function(data){
		alert(" Base class function 'validateBeforeSave()' needs to be Implemented ");
		return false;
	},
	/**
	 * 
	 * @param {Object} data
	 */
	validateBeforeUpdate:function(data){
		alert(" Base class function 'validateBeforeUpdate()' needs to be Implemented ");
		return false;
	},
	
	/**
	 * Retrive notes for specific Snippet
	 * @param {Object} key
	 */
	retriveNotes:function(key){
		return "";
	},
	
	/**
	 * Save notes for specific Snippet
	 * @param {Object} key
	 */
	saveNote:function(data){
		
	}
}
